<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //slice(从该位开始截取,截取到该位)不改变原数组
        var arr = [1, 2, 3, 4];
        arr.slice(1, 2) //得到[2,3]
        arr.slice(1) //从第一位截取到最后一位得到[2,3,4]
        arr.slice() //全部截取[1,2,3,4]
    </script>
</body>

</html>